home *** CD-ROM | disk | FTP | other *** search
- /*------------------------------------------------------------------------
- * $Id: isIn.c,v 1.1 1994/01/20 19:54:08 carlson Exp $
- *
- * This program checks if the first parameter is in any of the following
- * parameters and returns 0 if it is, or 1 if it isn't.
- *
- * Revision History:
- * $Log: isIn.c,v $
- * Revision 1.1 1994/01/20 19:54:08 carlson
- * Initial revision
- *
- *------------------------------------------------------------------------*/
-
- #include <stdio.h>
- #include <errno.h>
- #include <string.h>
-
- main (int argc, char *argv[])
- {
- char **argN;
-
- if (argc < 1)
- {
- fprintf (stderr, "Usage: isIn <string> <string1> [<stringN>]*\n");
- fprintf (stderr, " Returns 0 if <string> is the same as any\n");
- fprintf (stderr, " of the other parameters.\n");
- return 0;
- }
-
- for (argN = &argv[2]; *argN; argN++)
- {
- if (strcmp (argv[1], *argN) == 0)
- return 1;
- }
-
- return 0;
- }
-